import request from '@/utils/request'

// 获取数据列表/查询
export function vehicleList(data) {
  return request({
    url: `/owners/vehicle?current=${data.current}&pageSize=${data.pageSize}&create_time=${data.create_time}&license_plate=${data.license_plate}&community_code=${data.community_code}&building_code=${data.building_code}`,
    method: 'get'
  })
}

// 查询单个
export function getVehicle(id) {
  return request({
    url: `owners/vehicle/${id}`,
    method: 'GET'
  })
}
// 修改
export function editVehicle(data) {
  return request({
    url: `owners/vehicle/${data.id}`,
    method: 'PUT',
    data
  })
}

// 根据所属房产查询所属成员
export function houseMember(code) {
  return request({
    url: `/owners/member?house_code=${code}`,
    method: 'get'
  })
}
// 新增
export function addVehicle(data) {
  return request({
    url: 'owners/vehicle',
    method: 'POST',
    data
  })
}

// 删除
export function delVehicle(id) {
  return request({
    url: `owners/vehicle/${id}`,
    method: 'DELETE'
  })
}
